
package com.yjh.admin.server.sys.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yjh.admin.entity.user.SysMenu;
import com.yjh.admin.mapper.user.SysMenuMapper;
import com.yjh.admin.server.sys.SysMenuService;
import enums.MenuVO;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 菜单权限表
 *
 * @author GuoBin
 * @date 2020-10-14 16:49:40
 */
@Service
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService {
    @Override
    @Cacheable(value = "menu_details", key = "#roleId  + '_menu'")
    public List<MenuVO> findMenuByRoleId(Integer roleId) {
        return baseMapper.listMenusByRoleId(roleId);
    }

}
